<?php

require_once ('BaseService.php');
//DONE
/**
 * @author Virtualidad
 * @version 1.0
 * @created 29-dic-2010 09:57:49 a.m.
 */
class DepartamentosService extends BaseService {

    public function __construct($serviceBaseURL) {
        parent::__construct($serviceBaseURL);
    }

    public function getServiceClass() {
        return "Departamentos";
    }

    function GetAll() {
        $response = parent::invokeService("GetAll");
        $result = $response;

        if($this->shouldDecode){
            Loader::using("models::entities::Departamentos");
            $decoder = parent::getSerializer(parent::getMimeType(), "Departamentos", Departamentos::MAPPING());
            $result = $decoder->deserializeArray($response);
        }
        return $result;
    }

    /**
     *
     * @param Id
     */
    function GetById($Id) {
        $response = parent::invokeService("GetById", $Id);
        $result = $response;

        if($this->shouldDecode){
            Loader::using("models::entities::Departamentos");
            $decoder = parent::getSerializer(parent::getMimeType(), "Departamentos", Departamentos::MAPPING());
            $result = $decoder->deserialize($response);
        }

        return $result;
    }

    /**
     *
     * @param Codigo
     */
    function GetByPais($Codigo) {
        $response = parent::invokeService("GetByPais", $Codigo);
        $result = $response;

        if($this->shouldDecode){
            Loader::using("models::entities::Departamentos");
            $decoder = parent::getSerializer(parent::getMimeType(), "Departamentos", Departamentos::MAPPING());
            $result = $decoder->deserializeArray($response);
        }

        return $result;
    }

    function GetByNombrePais($nombre) {
        $response = parent::invokeService("GetByNombrePais", "\"$nombre\"");
        $result = $response;
        if($this->shouldDecode){
            Loader::using("models::entities::Departamentos");
            $decoder = parent::getSerializer(parent::getMimeType(), "Departamentos", Departamentos::MAPPING());
            $result = $decoder->deserializeArray($response);
        }

        return $result;
    }

}

?>